package rmi;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/*
*
*   服务器至少暴漏如下RPC/RMI接口：
*       bool add(Book b)  添加一个书籍对象
*       Book queryByID(int bookID)  查询指定ID的书籍对象
*       BookList queryByName(String name) 按书名查询书籍列表
*       bool delete(int bookID) 删除指定ID号的书籍对象
* 
*/
public class BookList implements Serializable{
	private List<Book> booklist;
	private static final long serialVersionUID = -128L;
	
    public BookList(){
        this.booklist = new ArrayList<>();
    }
    public void put(Book b){
        booklist.add(b);
    }
	public void disp() {
		System.out.println("booklist disp:");
		if(booklist.size() == 0) System.out.println("status: none booklist error");
		else {
			for(int i=0; i<booklist.size(); i++)
				booklist.get(i).disp();
		}
	}
}
